<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript">
        window.onload=function()
        {
            class Phone{
                //构造方法
                constructor(brand,price){
                    this.brand=brand;
                    this.price=price;
                }
                //声明父类的成员属性
                call(){
                    console.log("我可以打电话");
                }
            }

            class SmartPhone extends Phone{
                //构造方法
                constructor(brand,price,color,size){
                    super(brand,price);//Phone.call(this,brand,price)
                    this.color=color;
                    this.size=size;
                }
                photo(){
                    console.log("拍照");
                }
                playGame(){
                   console.log("玩游戏");
                }
                call(){
                    console.log("我也能打电话！");
                }
            }

            const huawei=new SmartPhone("华为",4999,"黑色","5.5inch");
            console.log(huawei);
            //调用call photo playGame三个方法
            huawei.call();
            huawei.photo();
            huawei.playGame();

        };
    </script>
</head>
<body>
    
</body>
</html>